package com.nut.common;

import com.nut.enums.OrderTagEnum;
import com.nut.util.DateUtil;

public class RedisKeys {

    public final static String SMS = "sms:";
    public final static String IMG_CODE = "img_code:";
    public final static String SMS_COUNT = "smscnt:";
    public final static String ORDER_LOCK = "order_lock:";
    public final static String REMIND_LOCK = "remind:";
    public final static String CHECKOUT_LOCK = "checkout:";
    public final static String ORDER_SYNC_START = "order_sync_start";
    public final static String GOODS_AMOUNT = "goods_amount:";


    public static final String getImgCodeKey(String uuid) {
        return IMG_CODE + uuid;
    }

    public static final String getSmsMobileKey(String mobile) {
        return SMS + mobile;
    }

    public static final String getSmsCountMobileKey(String mobile) {
        return SMS_COUNT + DateUtil.getNowDate() + ":" + mobile;
    }
//
//    public static final String getOrderKey(String orderId) {
//        return ORDER_LOCK + orderId;
//    }
//
//    public static final String getRemindKey(String orderId) {
//        return REMIND_LOCK + orderId;
//    }
//
//    public static final String getCheckOutKey(String orderId) {
//        return CHECKOUT_LOCK + orderId;
//    }
//
//    public static final String getGoodsAmount(String goodsId) {
//        return GOODS_AMOUNT + goodsId;
//    }
//
//    //yyMMdd+hotelId.sub(5) + orderType
//    public static final String getOrderIdPrefixKey(String hotelId, OrderTypeEnum orderTypeEnum) {
//        String date = DateUtil.getYYMMdd(0);
//        String hotelIdSub = hotelId.substring(5);
//        String prefix = date + hotelIdSub + orderTypeEnum.getValue();
//        return prefix;
//    }
//
    public static final String getPrefixKey(OrderTagEnum orderTagEnum) {
        String date = DateUtil.getYYMMdd(0);
        String prefix = date + orderTagEnum.getValue();
        return prefix;
    }

    public static void main(String[] args) {
//        System.out.println(DateUtil.getYYMMdd(0));
//        System.out.println(getSmsCountMobileKey("15157009867"));

    }
}
